import React, { Component } from 'react'

import {
    Platform,
    StyleSheet,
    Text,
	View,
    Image,
    TouchableWithoutFeedback
  } from 'react-native'

import ImageResources from './Resources/ImageResources'
import GetSetStorge from './GetSetStorge'
import Screen from './screen'
import { RouteHelper } from 'react-navigation-easy-helper'

export default class NoResult extends Component {
	constructor(props) {
		super(props);
	}
	 
	componentDidMount(){

	}

    search(){
        this.props.reSearch()
    }

    goBack(){
        RouteHelper.pop()
    }


	render() {
        return(
            <View style={styles.container}>
                <View style={styles.noResult}>
                    <View style={{marginLeft:2}}>
                        <Image  source={ImageResources.CommonIcon.NoResult} />
                    </View>
                    <View>
                        <Text style={[styles.fontSize15]}>没有搜索到您要的结果</Text>
                    </View>
                </View>
                          
                
                <View style={styles.noResultBut}>
                    <TouchableWithoutFeedback style={styles.search} activeOpacity={1} onPress={this.search.bind(this)}  >
                        <Text style={[styles.search]}>重新搜索</Text>
                    </TouchableWithoutFeedback>

                    <TouchableWithoutFeedback style={styles.goBack} activeOpacity={1} onPress={this.goBack.bind(this)}  >
                        <Text style={[styles.goBack]}>回到主页</Text>
                    </TouchableWithoutFeedback>
                    
                </View>	
            
            </View>
        )
	}      
}

const styles = StyleSheet.create({
	container:{
        flex: 1,
        flexDirection: 'column',
        // height:Screen.height,
        justifyContent: 'center',
        alignItems: 'center',
    },
    noResult:{
        flex: 3,
        justifyContent: 'center',
        alignItems: 'center',
    },
    noResultBut:{
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
    },
    fontSize15:{
        fontSize:14,
        color:'#bbb',
        marginTop:5
    },
    search:{
        backgroundColor:'#105eae',
        color:'#fff',
        width:Screen.width*0.8,
        paddingTop:6,
        paddingBottom: 6,
        alignItems: 'center',
        textAlign: "center",
        fontSize:15,
        borderRadius: 5,
        justifyContent: 'center',
    },
    goBack:{
        marginTop: 15,
        paddingTop:5,
        width:Screen.width*0.8,
        paddingBottom: 6,
        borderRadius: 6,
        backgroundColor:'#fff',
        color:'#105eae',
        alignItems: 'center',
        textAlign: "center",
        fontSize:15,
        borderWidth:1,
        borderStyle:'solid',
        borderColor:'#105eae',
        alignItems: 'center',
        
    }
});